package org.smr.ministore.dao;


import org.apache.ibatis.annotations.Param;
import org.smr.ministore.entities.GoodsOrgan;
import org.apache.ibatis.annotations.Mapper;
import org.blade.dao.base.BaseMapper;
import org.blade.dao.base.PageQueryMapper;
import org.smr.ministore.entities.GoodsTypeOrgan;
import org.smr.ministore.entities.vo.Assign2OrgansVO;
import org.smr.ministore.entities.vo.GoodsVO;

import java.util.List;


/**
 *
 **/
@Mapper
public interface GoodsOrganMapper extends BaseMapper<Long, GoodsOrgan>, PageQueryMapper<Long, GoodsOrgan> {

    /**
     * 逻辑删除
     *
     * @param id
     */
    int deleteByIdLogical(@Param("id") Long id);

    /**
     * 根据指派组织条件查询
     *
     * @param assign2Organs
     * @return List<GoodsOrgan>
     */
    List<GoodsOrgan> selectBy(@Param("assign2Organs") Assign2OrgansVO assign2Organs);

    /**
     * 根据商品信息查询组织引用关系
     *
     * @param goods 商品
     * @return List<GoodsOrgan>
     */
    List<GoodsOrgan> selectByGoodsId(@Param("goods") GoodsVO goods);


    /**
     * 查询已经商品类型己指派的组织
     *
     * @param assign2OrgansVO 所指派的组织
     * @return  List<GoodsTypeOrgan>
     */
    List<GoodsOrgan> queryAssignedOrgans(@Param("query")Assign2OrgansVO assign2OrgansVO);

}